import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;



public class ExonFile1 {

	
	public int getString(String str){
		try {
			
			
			String[] str1 = str.trim().split("-");
			if(str1.length > 1){
				System.out.println(str1[1]);
			}
			/*for(int i=0; i<str1.length; i++){
				System.out.println("array index===  "+str1[i]);
			}*/
			
		} catch (Exception e) {
			System.out.println(e);
			return 0;
		}
		System.out.println("hiiiiiiiiiiiii");
		return 1;
	}
	
	/*public boolean validString(String str){
		final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		format.setLenient(true);

		return format.equals(str);
	}*/
	boolean isValidDate(String input) {
		final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		if(input != null){
			 try {
		          format.parse(input);
		          return true;
		     }
		     catch(ParseException e){
		          return false;
		     }
		}else {
			return false;
		}
	    
	}
	public static String getExtension(File f) {
	    String ext = null;
	    String s = f.getName();
	    int i = s.lastIndexOf('.');

	    if (i > 0 &&  i < s.length() - 1) {
	        ext = s.substring(i+1).toLowerCase();
	    }
	    return ext;
	}
	public static String getCurrentTimestamp(){
	Calendar calendar = Calendar.getInstance();
	return new SimpleDateFormat("yyyyMMddHHmmss").format(calendar.getTime());
	}
	
	public Boolean isFileExist(File file){
		File[] filearray = file.listFiles();
		for(int i = 0; i< filearray.length; i++){
			
		}
		
		
		return true;
	}
	public static void main(String[] args) throws ParseException, IOException {
		/*String str ="ramakrishna";
		ExonFile1 ex = new ExonFile1();
		int i = ex.getString(str);
		System.out.println("I value"+i);*/
		
		/*String str ="rama";
		ExonFile1 ex = new ExonFile1();
		boolean flag = ex.isValidDate(str);
		System.out.println("flag value"+flag);
		
		File file = new File("C:\\filetesting"); 
		if(file.exists()){
			System.out.println("file existed ==========");
		}
		System.out.println("parentpath"+file.getPath());
		File[] filearr = file.listFiles();
		for(int i=0; i<filearr.length; i++){
			System.out.println(filearr[i]);
		}
		String fileExt = getExtension(file);
		System.out.println("fie extension"+fileExt);
		System.out.println(getCurrentTimestamp());
		*/
		//String str ="rama-E-aaa-aa";
		
		/*String str ="C:\\filetesting\\"; 
			String filename = str.substring(str.lastIndexOf("\\")+1);  
			
		System.out.println(filename);
		*/
		/*File file = new File("C:\\testing");
		File file1 = new File("C:\\testing1");
		File[] fileArr = file.listFiles();
		if((fileArr.length == 0) || (fileArr.length) > 1){
			System.out.println("hiiiiii");
		}
		System.out.println("hiiiii###"+fileArr[0].getName());
		if (fileArr[0].getName().indexOf(".") > 0) {
		  String  filename = fileArr[0].getName().substring(0, fileArr[0].getName().lastIndexOf("."));
		  System.out.println(filename);
		}*/
		/*File file = new File("C:\\testing\\rk.txt");
		if(file.createNewFile()){
			System.out.println("newly created");
		}else {
			System.out.println("already existed");
		}*/
		
		Map<String, Boolean> map = new HashMap<String, Boolean>();
		map.put("rama", true);
		map.put("krishna", true);
		map.put("rama1", false);
		System.out.println(map);
		String s = new String();
		String s1 = new  String();
		System.out.println(s.hashCode());
		System.out.println(s1.hashCode());
		
		
		
		/*System.out.println(file.getAbsoluteFile().getName());
		File file1 = new File("C:\\testing1");
		System.out.println(file.renameTo(file1));*/
		/*File[] listofFiles = file.listFiles();
		for(int i =0; i<listofFiles.length; i++){
			System.out.println(listofFiles[i]);
			file = new File(listofFiles[i].getPath());
			System.out.println(file.getPath());
		}*/
		
		
}
	
}
